@(articles: List[Article], articlesCount: Int, qas: List[QA], qaCount: Int, collectRes: List[StatCollect], collectResCount: Int)(implicit request: RequestHeader)

@main("欢迎来到社区！") {
<div class="main fly-user-main layui-clear">
  @sidebar("index")

  <div class="site-tree-mobile layui-hide">
    <i class="layui-icon">&#xe602;</i>
  </div>
  <div class="site-mobile-shade"></div>

  <div class="fly-panel fly-panel-user" pad20>
    <!--
    <div class="fly-msg" style="margin-top: 15px;">
      您的邮箱尚未验证，这比较影响您的帐号安全，<a href="activate.html">立即去激活？</a>
    </div>
    -->
    <div class="layui-tab layui-tab-brief" lay-filter="user">
      <ul class="layui-tab-title" id="LAY_mine">
        <li data-type="mine-jie" lay-id="article" class="layui-this">我的分享（<span>@articlesCount</span>）</li>
        <li data-type="mine-jie" lay-id="qa">我的提问（<span>@qaCount</span>）</li>
        <li data-type="collection" data-url="/collection/find/" lay-id="collection">我收藏的帖（<span>@collectResCount</span>）</li>
      </ul>
      <div class="layui-tab-content" style="padding: 20px 0;">
        <div class="layui-tab-item layui-show">
          <ul class="mine-view jie-row">
            @for(a <- articles){
            <li>
              <a class="jie-title" href="/article/view?_id=@a._id" target="_blank">@a.title</a>
              <i>@utils.DateTimeUtil.toString(a.timeStat.createTime, "yyyy/MM/dd HH:mm")</i>
              <a class="mine-edit" href="/article/edit?_id=@a._id">编辑</a>
              <em>@{a.viewStat.count}阅/@{a.replyStat.count}答</em>
            </li>
            }
          </ul>
        </div>
        <div class="layui-tab-item layui-show">
          <ul class="mine-view jie-row">
            @for(a <- qas){
            <li>
              <a class="jie-title" href="/qa/view?_id=@a._id" target="_blank">@a.title</a>
              <i>@utils.DateTimeUtil.toString(a.timeStat.createTime, "yyyy/MM/dd HH:mm")</i>
              <a class="mine-edit" href="/article/edit?_id=@a._id">编辑</a>
              <em>@{a.viewStat.count}阅/@{a.replyStat.count}答</em>
            </li>
            }
          </ul>
        </div>
        <div class="layui-tab-item">
          <ul class="mine-view jie-row">
            @for(c <- collectRes){
            <li>
              <a class="jie-title" href="/@{c.resType}/view?_id=@c.resId" target="_blank">@c.resTitle</a>
              <i>收藏于@utils.DateTimeUtil.toPrettyString(c.collectTime)</i>
            </li>
            }
          </ul>
        </div>
      </div>
    </div>
  </div>
</div>
}

<script>
layui.cache.page = 'user';
</script>
